<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateOrderTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('order', function(Blueprint $table)
		{
			$table->increments('id');
			$table->string('name');
			$table->integer('project');
			$table->string('customer_po_number')->nullable();
			$table->string('attachment1')->nullable();
			$table->string('jenkins_po_number')->nullable();
			$table->string('jenkins_pi_number')->nullable();
			$table->string('attachment2')->nullable();
			$table->string('factory')->nullable();
			$table->string('terms')->nullable();
			$table->string('account_payment')->nullable();
			$table->string('customer_model_number')->nullable();
			$table->string('customer_part_number')->nullable();
			$table->string('jenkins_model_number')->nullable();
			$table->string('jenkins_part_number')->nullable();
			$table->string('payment_one_schedule')->nullable();
			$table->boolean('payment_one_status')->nullable();
			$table->string('payment_one_attachment')->nullable();
			$table->string('payment_two_schedule')->nullable();
			$table->boolean('payment_two_status')->nullable();
			$table->string('payment_two_attachment')->nullable();
			$table->string('payment_three_schedule')->nullable();
			$table->boolean('payment_three_status')->nullable();
			$table->string('payment_three_attachment')->nullable();
			$table->string('final_total_amount_received')->nullable();
			$table->string('delivery_date_one')->nullable();
			$table->string('delivery_date_two')->nullable();
			$table->text('desc', 65535)->nullable();
			$table->dateTime('submit_time');
			$table->dateTime('end_time')->nullable();
			$table->integer('status');
			$table->boolean('valid')->default(1);
			$table->integer('quantity')->default(0);
			$table->float('inner_cost', 10, 0)->nullable();
			$table->string('inner_cost_currency', 3)->nullable();
			$table->float('external_cost', 10, 0)->nullable();
			$table->string('external_cost_currency', 3)->nullable();
			$table->boolean('published')->nullable();
			$table->integer('delivery_status_one')->nullable()->default(-1);
			$table->integer('delivery_status_two')->nullable()->default(-1);
			$table->text('waiverDesc')->nullable();
			$table->integer('isFulfilled')->nullable()->default(-1);
			$table->timestamps();
			$table->softDeletes();
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('order');
	}

}
